package hu.issue.framework.security;

import hu.issue.entity.User;

public class SecurityContext {
	private static ThreadLocal<User> user = new ThreadLocal<User>();
	
	public static boolean isCurrentUserInRow(String roleName) {
		return getCurrentUser().isInRole(roleName);
	}
	
	public static void setCurrentUser(User user) {
		SecurityContext.user.set(user);
	}
	
	public static User getCurrentUser() {
		return user.get();
	}
}
